package cn.cslg.tieba.web;

import cn.cslg.tieba.domain.entity.User;
import cn.cslg.tieba.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wu Zhenwei
 * 2017/11/20
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public User login(User user) {
        return userService.login(user);
    }

    @PostMapping("/register")
    public User register(User user){
        return  userService.register(user);
    }

}
